const { sequelize, DataTypes } = require('../../utill/getSequelize')

//各个课程目标的权重
const Class_Target_Weight = sequelize.define('Class_Target_Weight', {
  id: {
    type: DataTypes.INTEGER,
    primaryKey: true,
    autoIncrement: true,
  },



  class_target_name: {//课程目标名字   //原本是id我改了
    type: DataTypes.STRING,
    // allowNull: false,
  },


  weights: {//权值
    type: DataTypes.FLOAT,
    // allowNull: false,
  },

  t_user_and_a_c_s_id: {
    type: DataTypes.INTEGER,
    allowNull: false,
  },


});


//同步模型和数据库表
(async () => {
  try {
    await sequelize.sync({ force: false });
    console.log('All models were synchronized successfully.');
  } catch (error) {
    console.log(error);
  }

})();

//提供出去
module.exports = { Class_Target_Weight };